<template>
  <el-menu :default-openeds="['1', '3']" style="min-height: 100%;overflow-x: hidden"
           background-color="rgb(48, 65, 86)"
           text-color="white"
           :collapse=isCollapse
           active-text-color="#ffd04b"
           :collapse-transition="false"
           @open="handleOpen"
           @close="handleClose"
  >
    <div style="height: 60px;line-height: 60px;text-align: center;color: white">
      <img src="../assets/logo.png" style="border-radius: 100%; position: relative; top: 7px;"/>
      <b v-show="logoTextShow">&nbsp;&nbsp;智慧工作室后台</b>
    </div>
    <router-link to="/home" style="text-decoration: none">
      <el-menu-item index="1">
        <i class="el-icon-house"></i>
        <span slot="title">主页</span>
      </el-menu-item>
    </router-link>
    <el-submenu index="2">
      <template slot="title">
        <i class="el-icon-menu"></i>
        <span slot="title">系统管理</span>
      </template>
      <router-link to="/user" style="text-decoration: none">
        <el-menu-item index="2-1">
          <i class="el-icon-user-solid"></i>
          用户管理
        </el-menu-item>
      </router-link>
      <router-link to="/device" style="text-decoration: none">
        <el-menu-item index="2-2">
          <i class="el-icon-cpu"></i>
          设备管理
        </el-menu-item>
      </router-link>
      <router-link to="/area" style="text-decoration: none">
        <el-menu-item index="2-3">
          <i class="el-icon-location"></i>
          场所管理
        </el-menu-item>
      </router-link>
      <router-link to="/history" style="text-decoration: none">
        <el-menu-item index="2-4">
          <i class="el-icon-time"></i>
          历史数据
        </el-menu-item>
      </router-link>
    </el-submenu>
  </el-menu>

</template>

<script>
export default {
  name: "Aside",
  props: {
    isCollapse: Boolean,
    logoTextShow: Boolean
  },
  methods:{
    handleOpen(key, keyPath) {
      console.log(key, keyPath);
    },

    handleClose(key, keyPath) {
      console.log(key, keyPath);
    }
  }
}
</script>

<style scoped>

</style>
